package com.ydj.app.third.ai.deepseek;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class DeepseekChatStreamCompletionsRes implements Serializable {


    /**
     * id : bca1b975-1f09-4b50-a170-dc540e9c3a6c
     * object : chat.completion.chunk
     * created : 1747534725
     * model : deepseek-reasoner
     * system_fingerprint : fp_5417b77867_prod0425fp8
     * choices : [{"index":0,"delta":{"content":"","reasoning_content":null},"logprobs":null,"finish_reason":"stop"}]
     * usage : {"prompt_tokens":35,"completion_tokens":588,"total_tokens":623,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":286},"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":35}
     */

    private String id;
    private String object;
    private Long created;
    private String model;
    private String system_fingerprint;
    private UsageBean usage;
    private List<ChoicesBean> choices;

    @Data
    public static class UsageBean implements Serializable {
        /**
         * prompt_tokens : 35
         * completion_tokens : 588
         * total_tokens : 623
         * prompt_tokens_details : {"cached_tokens":0}
         * completion_tokens_details : {"reasoning_tokens":286}
         * prompt_cache_hit_tokens : 0
         * prompt_cache_miss_tokens : 35
         */

        private Long prompt_tokens;
        private Long completion_tokens;
        private Long total_tokens;
        private PromptTokensDetailsBean prompt_tokens_details;
        private CompletionTokensDetailsBean completion_tokens_details;
        private Long prompt_cache_hit_tokens;
        private Long prompt_cache_miss_tokens;

        @Data
        public static class PromptTokensDetailsBean implements Serializable {
            /**
             * cached_tokens : 0
             */

            private Long cached_tokens;
        }

        @Data
        public static class CompletionTokensDetailsBean implements Serializable {
            /**
             * reasoning_tokens : 286
             */

            private Long reasoning_tokens;
        }
    }

    @Data
    public static class ChoicesBean implements Serializable {
        /**
         * index : 0
         * delta : {"content":"","reasoning_content":null}
         * logprobs : null
         * finish_reason : stop
         */

        private Long index;
        private DeltaBean delta;
        private Object logprobs;
        private String finish_reason;

        @Data
        public static class DeltaBean implements Serializable {
            /**
             * content :
             * reasoning_content : null
             */

            private String content;
            private String reasoning_content;
        }
    }
}
